/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

list-editable {
    $min-height: 47px;
    $index-column-width: 46px;
    $index-color: #757575;

    display: block;
    flex: 1;
    transition: 0.2s opacity;    

    &[disabled] {
        opacity: 0.5;
        cursor: not-allowed;
        pointer-events: none;
    }

    [list-editable-transclude='itemView'] {
        flex: 1;
    }

    &-item-view,
    &-item-edit,
    &-no-items {
        flex: 1;
        display: block;
    }

    &-no-items {
        padding: 8px 20px;
        display: flex;
        align-items: center;
        min-height: $min-height;
        padding: 8px 20px;
        margin: -6px 0;

        font-style: italic;
    }

    .le-body {
        box-shadow: 0 1px 0 0 rgba(0, 0, 0, 0.2);
    }

    .le-row-sort {
        display: none;
    }

    .le-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        min-height: $min-height;
        padding: 5px 0;
        background-color: var(--le-row-bg-color); // Ilya Borisov: does not work in IE11
        border-top: 1px solid #ddd;

        &:nth-child(odd) {
            --le-row-bg-color: #ffffff;
        }

        &:nth-child(even) {
            --le-row-bg-color: #f9f9f9;
        }

        &-index,
        &-cross {
            display: flex;
            height: 36px;
        }

        &-index {
            width: $index-column-width;
            flex-basis: $index-column-width;
            padding-left: 10px;
            flex-shrink: 0;
            flex-grow: 0;
            align-items: center;
            justify-content: center;
            color: $index-color;
        }

        &-sort {
            display: none;
        }

        &-cross {
            [ignite-icon] {
                width: 12px;
                height: 12px;
            }
        }

        &-item {
            width: 100%;

            &-view {
                display: flex;
                min-height: 36px;
                align-items: center;
            }
        }

        &--editable {
            position: relative;
            z-index: 1;

            align-items: flex-start;
        }

        &--has-item-view {
            cursor: pointer;
        }

        &:not(.le-row--has-item-view) {
            align-items: flex-start;
        }
    }

    [divider]:after {
        content: attr(divider);

        display: inline-flex;
        justify-content: center;
        align-self: flex-start;

        width: 20px;
        height: 36px;

        margin-top: 18px;
        margin-right: -20px;
        
        line-height: 36px;
    }
}
